
<style scoped>
  .clientInventory{
    margin-right: 15px;
    padding: 0 15px;
    background-color: white;
    height: 94.5vh;
    position: relative;
  }
  .ci-top{
    display: flex;
    padding-top: 15px;
  }
  .ci-top p:first-child{
    margin: 3px 6px 0 0;
    display: inline-block;
    white-space:nowrap;
    /* width: 48px; */
    /* text-align: right; */
  }
  .ci-top p:not(:first-child){
    margin: 3px 6px 0 12px;
    display: inline-block;
    white-space:nowrap;
    /* width: 48px;
    text-align: right; */
  }
  .top_inp{
    width: 160px;
  }
  .wi-button{
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
  }
  .wi-button div:nth-child(2){
    display: flex;
  }
  .footView span{
    float: left;
    margin-right: 48px;
    line-height: 6vh;
    font-size: 14px;
  }
  .footView span i{
    margin-right: 5px;
  }

</style>

<style>
  .clientInventory .ci-top .el-input__inner{
    height: 30px;
  }
  .clientInventory .ci-top .el-checkbox.is-bordered{
    padding: 4px 5px 0px 5px;
    margin-left: 12px;
    height: 30px;
  }
  .clientInventory .wi-button .el-checkbox.is-bordered{
    padding: 4px 5px 0px 5px;
    margin-right: 10px;
    margin-left: 0;
    height: 30px;
  }
  .clientInventory .ci-top .el-date-editor .el-range__icon{
    line-height: 24px;
  }
  .clientInventory .ci-top .el-date-editor .el-range-separator{
    line-height: 23px;
    width: 14%;
  }
  .clientInventory .ci-top .el-date-editor .el-range__close-icon{
    line-height: 25px;
  }
  .clientInventory .ci-top .el-input__icon{
    line-height: 30px;
  }
</style>

<template>
  <div class="clientInventory">
    <!-- 售价库存表 -->
    <div style="border-bottom:2px solid #f4f4f4;padding-bottom:15px;">
    <div class="ci-top">
      <p>客户</p>
      <el-input v-model="customerNo" style="width:60px;margin-right:10px;" @blur="Change1" :disabled="jxAgent"></el-input>
        <el-select :disabled="jxAgent"
          @change="Change"
          style="width:100px;"
          v-model="customerName"
          placeholder="请选择">
          <el-option
            v-for="item in customerList"
            :key="item.value + Math.random()"
            :label="item.label"
            :value="item.value + item.value2">
            <span style="float:left">{{item.value1}}</span>
            <span style="float:right">{{item.value}}</span>
          </el-option>
        </el-select>

        <p>款号</p>
        <el-input class="top_inp" v-model="kindsNumberListStr"></el-input>

        <!-- <el-select
          v-model="kindsNumberListStr"
          multiple
          filterable
          collapse-tags
          style="width:170px"
          placeholder="请选择">
          <el-option
            v-for="item in kindsNumberList"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select> -->

        <p>总店编号</p>
        <el-input v-model="headquartersNo" class="top_inp"></el-input>

        <p style="margin-left:42px;">客存</p>
        <el-select
          style="width:80px;margin-right:10px;"
          v-model="inventoryExpression">
          <el-option
            v-for="item in inventoryExpressionList"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
        <el-input v-model="inventory" style="width:80px;"></el-input>

        <p>业务</p>
        <el-select
          multiple
          collapse-tags
          class="top_inp"
          v-model="businessListStr"
          placeholder="请选择">
          <el-option
            v-for="item in businessarr"
            :key="item.value + Math.random()"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>

        <p>季度</p>
        <el-select
          multiple
          collapse-tags
          class="top_inp"
          v-model="quarterListStr"
          placeholder="请选择">
          <el-option
            v-for="item in quartListStrList"
            :key="item.value + Math.random()"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>

        <p>日期</p>
        <el-date-picker
          unlink-panels
          style="width:300px;"
          v-model="timeDate"
          type="daterange"
          value-format="yyyy-MM-dd" format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
    </div>

    <div class="ci-top">
      <p>品牌</p>
      <el-select
          style="width:170px;"
          v-model="brandedName"
          clearable
          placeholder="请选择">
          <el-option
            v-for="item in brandList"
            :key="item.value + Math.random()"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>

        <p>大类</p>
        <el-select
          class="top_inp"
          clearable
          v-model="commodityType"
          placeholder="请选择">
          <el-option
            v-for="item in commodityTypeList"
            :key="item.value + Math.random()"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>

      <p>实际销量</p>
      <el-input v-model="actualSales" class="top_inp"><template slot="prepend">>=</template></el-input>
      <p>实际进量</p>
      <el-input v-model="actualInput" style="width:170px;"><template slot="prepend">>=</template></el-input>
    </div>
    </div>

    <div class="wi-button">
      <div>
        <el-button @click="query" type="primary" icon="el-icon-search">查询</el-button>
        <el-button @click="exportExcel" icon="el-icon-upload2">导出</el-button>
        <el-button v-print="'#outTable'" icon="el-icon-printer">列印</el-button>
        <!-- <el-button @click="startPrint" icon="el-icon-printer">列印</el-button> -->
        <el-button @click="showscn" icon="el-icon-copy-document">筛选款号</el-button>
      </div>
      <div>
        <div :style="{display:showcheck}">
        <el-checkbox v-model="checked2" label="筛选款号" border></el-checkbox>
        </div>
        <el-checkbox v-model="isCustomerTotal" label="客户合计" border></el-checkbox>
        <el-checkbox v-model="isHeadquarters" label="总店合计" border></el-checkbox>
        <el-checkbox v-model="checked5" label="累计<>0" border></el-checkbox>
        <el-checkbox v-model="isTwoQuery" label="二维" border></el-checkbox>
        <el-checkbox v-model="showImg" label="显示图片" border></el-checkbox>
      </div>
    </div>

    <el-table
      id="outTable"
      height="69vh"
      border
      :header-cell-style="{background:'#f4f4f4',padding:0,height:'40px'}"
      :cell-style="{padding:0,height:'26px'}"
      :data="tableData"
      highlight-current-row
      :default-sort = "{prop: 'date', order: 'descending'}"
      :summary-method="getList"
      show-summary
      style="width: 100%"
      @row-click="rowClick">
      
      <template v-for="i in cList" >
      <el-table-column
        show-overflow-tooltip
        :prop="i.prop"
        sortable
        :key="i.prop"
        :label="i.label"
        :width="i.width"
        v-if="i.isShow">
      </el-table-column>
      </template>
    </el-table>


    <!-- 筛选框 -->
    <screen-num
    :style="{display:Scn}"
    @closeScn="closeScn"
    @preservation="preservation">
    </screen-num>

    <!-- 分頁 -->
    <foot-view class="footView" 
      :pagesNum="pagesNum"
      :hasPagination=true
      :pageSize="limit"
      @handleSizeChange="handleSizeChange"
      @handleCurrentChange="handleCurrentChange">
      <div slot="text">
        <el-popover
          placement="top-start"
          width="120"
          max-height="100px"
          trigger="click">
          <el-checkbox-group v-model="selectHeaderList" >
            <el-checkbox 
              v-for="i in headerList" 
              :label="i.value" 
              :key="i.value+Math.random()"
              style="margin-bottom:7px"></el-checkbox>
          </el-checkbox-group>
          <i slot="reference" class="el-icon-date">  表头配置</i>
        </el-popover>
        <span>数据库：{{jxQuarter}}</span>
      </div>
    </foot-view>

    <show-image v-if="showImg" :imgSrc="imgSrc" @closeImg="() => {this.showImg=false}"></show-image>
    <print-page v-show=false :manufacturerName="manufacturerName" :printStyle="printStyle"></print-page>
  </div>
</template>

<script>
const resources = require('../../../config/printCSS')
import printPage from '../../../components/PrintVendorStock'
import footView from '../../../components/FootView'
import screenNum from '../WarehouseInventory/childComp/screenNum'
import {getModel} from '../../../network/manufacturer'
import {getClerk} from '../../../network/clerk'
import { getBranded } from '../../../network/branded'
import today from '../../../components/mixins/today'
import {getCategory} from '../../../network/artNo'
import {getCI,getClient,getTwoCI,getSum,getSum1} from '../../../network/client'
import {getQuarter,getNumber} from '../../../network/quarter'
import outex from '../../../components/mixins/outexp'
import enterUp from '../../../components/mixins/enterUp'
import showImage from '../../../components/showImage.vue'
export default {
  name:'client_inventory',
  mixins:[today,outex,enterUp],
  created(){

    var testeArray = [{name: "Jovem1", esteira: "Macaco"}, {name: "Jovem", esteira: "Doido", horse: "Chimbinha" }],
    names = Object.create(null),
    result;

    testeArray.forEach(o =>{
      console.log(Object.keys(o))
        Object.keys(o).forEach(k => {
            // names[k] = true;
            console.log(Object.keys(o))
        });
    });

    result = Object.keys(names);
    console.log(result);


    this.inpList = this.getInput()
    // this.kindsNumberListStr = ''
    // this.quarterListStr = []
    // this.timeDate = [this.getLastWeek(),this.getNowTime()]
    this.cList = this.cList1

    this.getCalculationList()
  
      //获取业务
      getClerk().then(res=>{
      let list = res.data.data
      // console.log(list)
      list.forEach(element => { 
        
          this.businessarr.push({label:element.name,value:element.name})
        
      })
    })
    //品牌
    getBranded().then(res => {
            // console.log(res)
            res.data.data.forEach(e => {
              this.brandList.push({value:e.id,label:e.name})
            })
          });
    //大类
    getCategory().then(res=>{
      // console.log(res)
      let list = res.data.data
      list.forEach(element => {
        this.commodityTypeList.push({label:element.type,value:element.id})
      })
    });
    // 获取所有客户信息
    getClient({limit:99999}).then(res => {
      console.log(res.data)
      res.data.data.forEach(e => {
        if(e.stop != 1){
          this.customerList.push({value:e.name,label:e.name,value1:e.no,value2:e.id,value3:e.id})
        }
      })
      if (this.jxAgent) {
          for (const i of this.customerList) {
            if (i.label == this.operator) {
              this.customerNo = i.value1
              this.customerName = i.value + i.value2
              this.customerId = i.value2
              break
            }
          }
        }
    });

    //季度
    getQuarter().then(res=>{
      console.log(res.data)
      let qList = res.data.data
      qList.forEach(e=>{
        this.quartListStrList.push({label:e.name,value:e.id})
      })
    });
    //款号
    getNumber(JSON.stringify([''])).then(res => {
      console.log(res.data)
      if (res.data.code == 200) {
        res.data.data.forEach(e => {
          this.kindsNumberList.push({value:e.styleNumber,label:e.styleNumber})
        })
      }
    })
  },
  components:{
    footView,
    screenNum,
    printPage,
    showImage,
  },
  data(){
    return{
      printStyle:0,
      // 打印
      styleList: [],
      manufacturerName:'1-1',
      sortArr:[],
      calculationList:[],
      isCustomerTotal:false,
      jxQuarter: document.cookie.match(new RegExp("jxQuarter" + name + "=([^;]*)(;|$)"))[1],
      jxAgent: document.cookie.match(RegExp('jxAgent'+'=([^;]+)'))[1] == 1 ? true : false,
      operator: document.cookie.match(RegExp('jxUser'+'=([^;]+)'))[1],
      allData:[],
      //数据总条数
      dataLen:0,
      //总页码数
      pagesNum:0,
      //每页显示条数
      limit:20,
      // 当前页码
      currentPage: 1,
      inpList:[],
      customerList:[],
      customerNo:'',
      customerName:'',
      kindsNumberListStr:'',
      headquartersNo:'',
      inventoryExpression:'>=',
      inventoryExpressionList:[
        {label:'>=',value:'>='},
        {label:'=',value:'='},
        {label:'<=',value:'<='},
      ],
      inventory:'',
      businessListStr:'',
      quarterListStr:'',
      businessarr:[],//业务
      brandedName:'',
      brandList:[],
      commodityType:'',
      commodityTypeList:[],
      actualSales:'',
      actualInput:'',


      kindsNumberList:[],
      // List:[],
      selectHeaderList:['款号','颜色','售价','客户简称','品牌名称','尺码'],//foot-view
      headerList:[
        {value:'款号'},{value:'颜色'},{value:'售价'},{value:'客户简称'},{value:'品牌名称'},{value:'尺码'}
      ],
      Scn:'none',
      showinp:'none',
      showcheck:'none',
      checked2:false,
      isTwoQuery:false,
      showImg: false,
      isHeadquarters:false,
      checked5:false,
      timeDate:'',
      value2:'',
      quartListStrList:[],
      cList:[],
      cList1:[
        {isShow:true,prop:'styleNumber',label: '款号',width:'140px'},
        // {isShow:true,prop:'colorName',label: '颜色名称',width:'105px'},
        {isShow:true,prop:'colorNo',label: '颜色',width:'110px'},
        {isShow:true,prop:'size',label: '尺码'},
        {isShow:true,prop:'sellingPrice',label: '售价'},
        {isShow:true,prop:'customerNo',label: '客户简称',width:'150px'},
        // {isShow:true,prop:'name',label: '客户简称',width:'110px'},
        {isShow:true,prop:'brandedName',label: '品牌名称',width:'110px'},
        {isShow:true,prop:'depositRepertoryNumber',label: '上存'},
        {isShow:true,prop:'customerInputNumber',label: '客进'},
        {isShow:true,prop:'customerOutNumber',label: '客退'},
        {isShow:true,prop:'customerSellNumber',label: '客销'},
        {isShow:true,prop:'customerSellMoney',label: '客销金额',width:'110px'},
        {isShow:true,prop:'customerRepertoryNumber',label: '客存'},
        {isShow:true,prop:'firstInputDate',label: '首进日',width:'130px'},
        {isShow:true,prop:'firstSellDate',label: '首销日',with:'130px'},
      ],
      cList2:[
        {isShow:true,prop:'styleNumber',label: '型号',width:'140px'},
        {isShow:true,prop:'colorName',label: '颜色'},
        {isShow:true,prop:'sellingPrice',label: '售价'},
        {isShow:true,prop:'customerNo',label: '客户编号',width:'110px'},
        {isShow:true,prop:'customerName',label: '客户简称',width:'110px'},
        {isShow:true,prop:'repertoryFiveNumber',label: '05-XS',width:'90px'},
        {isShow:true,prop:'repertorySevenNumber',label: '07-S'},
        {isShow:true,prop:'repertoryNineNumber',label: '09-M',width:'85'},
        {isShow:true,prop:'repertoryElevenNumber',label: '11-L'},
        {isShow:true,prop:'repertoryThirteenNumber',label: '13-XL',width:'90px'},
        {isShow:true,prop:'repertoryFifteenNumber',label: '15-2L',width:'85'},
        {isShow:true,prop:'repertorySeventeenNumber',label: '17-3L',width:'85'},
        {isShow:true,prop:'repertoryNineteenNumber',label: '19-4L',width:'85'},
        {isShow:true,prop:'repertoryTwentyOneNumber',label: '21-5L',width:'85'},
        {isShow:true,prop:'repertoryTwentyThreeNumber',label: '23-6L',width:'85'},
        {isShow:true,prop:'repertoryFNumber',label: 'D'},
        {isShow:true,prop:'customerRepertoryNumber',label: '小计'},
        {isShow:true,prop:'customerRepertoryMoney',label: '金额',width:'90'},
        {isShow:true,prop:'firstInputDate',label: '首进日',width:'160px'},
      ],
      tableData:[],
      ary:['季度','季度id','货号id','客户id','id','货号值'],
      sendList2:[],
      sendList:[],
      sendList3:[],
      sendList4:[],
      ary1:['季度','季度id','客户id','颜色编号','客户c05客存数量','客户c07客存数量','客户c09客存数量','客户c11客存数量','客户c13客存数量','客户c15客存数量',
      '客户c17客存数量','客户c19客存数量','客户c21客存数量','客户c23客存数量','客户F客存数量','客户库存数量'],
      List:[],
      resultList:[],
      newArr:[],
      customerId:'',
      result:[],
      headerList1:[],
      depositRepertoryNumber:'',
      customerInputNumber:'',
      customerOutNumber:'',
      customerSellNumber:'',
      customerSellMoney:'',
      customerRepertoryNumber:'',
      repertoryFiveNumber:'',
      repertorySevenNumber:'',
      repertoryNineNumber:'',
      repertoryElevenNumber:'',
      repertoryThirteenNumber:'',
      repertoryFifteenNumber:'',
      repertorySeventeenNumber:'',
      repertoryNineteenNumber:'',
      repertoryTwentyOneNumber:'',
      repertoryTwentyThreeNumber:'',
      repertoryFNumber:'',
      customerRepertoryMoney:'',

      imgSrc: ''
    }
  },
  methods:{
    startPrint(){
      this.clearPrintTable()
      this.styleList = []
      this.printStyle = 0
      this.$confirm('是否使用A4纸打印', '提示', {
        distinguishCancelAndClose: true,
        confirmButtonText: '是',
        cancelButtonText: '否',
        type: 'warning'
      }).then(() => {
        // 用A4纸
        this.openPrint(true)
      }).catch(action => {
        // 用半张A4纸  
        if (action == 'cancel') {
          this.openPrint(false)
        }
      })
    },
    openPrint(isA4, x=1, id='printTable'){
      let index = --x
      let printTable = document.getElementById(id)
      let length = this.tableData.length

      for (index; index < length; index++) {
        const e = this.tableData[index]
        // console.log(e)
        // console.log(index)
        // console.log(index+1)
        // this.printTotal += Number(e.customerRepertoryNumber)
        // this.printMoney += Number(e.money)
        // this.printSellingPrice += Number(e.customerRepertoryMoney)

        let row = printTable.insertRow(printTable.FetchRowCount)
        row.insertCell(0).innerHTML = index+1
        row.insertCell(1).innerHTML = e.styleNumber + '-' + e.colorNo
        row.insertCell(2).innerHTML = e.colorName
        row.insertCell(3).innerHTML = e.commodityName
        row.insertCell(4).innerHTML = e.repertoryFiveNumber
        row.insertCell(5).innerHTML = e.repertorySevenNumber
        row.insertCell(6).innerHTML = e.repertoryNineNumber
        row.insertCell(7).innerHTML = e.repertoryElevenNumber
        row.insertCell(8).innerHTML = e.repertoryThirteenNumber
        row.insertCell(9).innerHTML = e.repertoryFifteenNumber
        row.insertCell(10).innerHTML = e.repertorySeventeenNumber
        row.insertCell(11).innerHTML = e.repertoryNineteenNumber
        row.insertCell(12).innerHTML = e.repertoryTwentyOneNumber
        row.insertCell(13).innerHTML = e.repertoryTwentyThreeNumber
        row.insertCell(14).innerHTML = e.repertoryFNumber
        row.insertCell(15).innerHTML = e.customerRepertoryNumber
        row.insertCell(16).innerHTML = e.sellingPrice
        row.insertCell(17).innerHTML = e.customerRepertoryMoney

        if (isA4) {
          // console.log(parseInt((index+1)/33))
          // console.log((index+1)%33 == 0)
          if (parseInt((index+1)/33) && (index+1)%33 == 0 && (index+1) != length) {
            console.log('33倍数')
            let pageIndex = index + 3 - (parseInt(index/33)*33)
            // console.log(pageIndex)
            // console.log(index+1)    // 33
            // console.log(length)     // 36
            let startingPoint = index - 32
            let pageTotal = 0
            let pageMoney = 0
            for (let j = startingPoint; j <= index; j++) {
              pageTotal += Number(this.tableData[j].customerRepertoryNumber)
              pageMoney += Number(this.tableData[j].customerRepertoryMoney)
            }

            let rowEnd = printTable.insertRow(printTable.FetchRowCount)
            rowEnd.insertCell(0).innerHTML = '本页小计：'
            printTable.rows[pageIndex].cells[0].colSpan = '2'
            rowEnd.insertCell(1).innerHTML = pageTotal
            printTable.rows[pageIndex].cells[1].colSpan = '2'
            rowEnd.insertCell(2).innerHTML = '汇总金额：'
            printTable.rows[pageIndex].cells[2].colSpan = '4'
            rowEnd.insertCell(3).innerHTML = pageMoney.toFixed(2)
            printTable.rows[pageIndex].cells[3].colSpan = '10'

            let newHead = document.createElement('div')
            newHead.classList.add("addPrintHead")
            newHead.innerHTML = `
              <p class="rightTag" style="top: ${(index+1)/33 * 29.7 + 3}cm;">白联仓库 红联财务 黄联客户</p>
              <span class="printHead">
                ${this.manufacturerName}${this.jxQuarter}客户库存表1
              </span>
              <div class="info" style="height: 25px;">
                <p style="margin: 5px 0;">厂商：${this.printVendorName}</p>
                <p style="margin: 5px 0;">联系人：${this.contact}</p>
                <p style="margin: 5px 0;">进货序号：${this.inputSequence}</p>
              </div>
              <div class="info" style="height: 25px;">
                <p style="margin: 5px 0;">厂商电话：${this.phone}</p>
                <p style="margin: 5px 0;">进货日期：${this.inputDate}</p>
              </div>
              <div class="info" style="height: 25px;">
                <p style="margin: 5px 0;">公司地址：${this.address}</p>
              </div>
            `
            newHead.style.pageBreakBefore = 'always'
            this.insertAfter(newHead, printTable)

            let tableId = `printTable${(index+1)/33}`
            // console.log(tableId)
            let tableDom = document.createElement("table")
            tableDom.border = '1'
            tableDom.align = 'center'
            tableDom.id = tableId
            tableDom.innerHTML = `
              <thead>
                <tr>
                  <td style="width: 4%;padding: 0;text-align: center;" rowspan="2">序号</td>
                  <td style="width: 15%;padding: 0;text-align: center;" rowspan="2">型色</td>
                  <td style="width: 8%;padding: 0;text-align: center;" rowspan="2">颜色</td>
                  <td style="width: 15%;padding: 0;text-align: center;" rowspan="2">品名</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">05</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">07</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">09</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">11</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">13</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">15</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">17</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">19</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">21</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">23</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;">F</td>
                  <td rowspan="2" style="text-align: center;width: 5%;">数量</td>
                  <td rowspan="2" style="text-align: center;width: 5%;">售价</td>
                  <td rowspan="2" style="text-align: center;">金额</td>
                </tr>
                <tr>
                  <td style="text-align: center;border-top: 1px dotted;border-left: 1px dotted;">XS</td>
                  <td style="text-align: center;border-top: 1px dotted;">S</td>
                  <td style="text-align: center;border-top: 1px dotted;">M</td>
                  <td style="text-align: center;border-top: 1px dotted;">L</td>
                  <td style="text-align: center;border-top: 1px dotted;">XL</td>
                  <td style="text-align: center;border-top: 1px dotted;">2L</td>
                  <td style="text-align: center;border-top: 1px dotted;">3L</td>
                  <td style="text-align: center;border-top: 1px dotted;">4L</td>
                  <td style="text-align: center;border-top: 1px dotted;">5L</td>
                  <td style="text-align: center;border-top: 1px dotted;">6L</td>
                  <td style="text-align: center;border-top: 1px dotted;"></td>
                </tr>
              </thead>
            `
            // console.log(tableDom)
            // console.log(index)
            this.printStyleCount(e.styleNumber)
            this.insertAfter(tableDom, newHead)
            this.openPrint(true,index+2,tableId)
            return
          }
          if ((index+1) == length) {
            let pageIndex = index + 3 - (parseInt(index/33)*33)
            // console.log('最后一行')
            let startingPoint = index < 33 ? 0 : parseInt(index/33)*33
            let pageTotal = 0
            let pageMoney = 0
            for (let j = startingPoint; j <= index; j++) {
              pageTotal += Number(this.tableData[j].customerRepertoryNumber)
              pageMoney += Number(this.tableData[j].customerRepertoryMoney)
            }
            let rowEnd = printTable.insertRow(printTable.FetchRowCount)
            rowEnd.insertCell(0).innerHTML = '本页小计：'
            printTable.rows[pageIndex].cells[0].colSpan = '2'
            rowEnd.insertCell(1).innerHTML = pageTotal
            printTable.rows[pageIndex].cells[1].colSpan = '2'
            rowEnd.insertCell(2).innerHTML = '汇总金额：'
            printTable.rows[pageIndex].cells[2].colSpan = '4'
            rowEnd.insertCell(3).innerHTML = pageMoney.toFixed(2)
            printTable.rows[pageIndex].cells[3].colSpan = '10'
          }
        } else {
          if (parseInt((index+1)/12) && (index+1)%12 == 0 && (index+1) != length) {
            // console.log('12倍数')
            let pageIndex = index + 3 - (parseInt(index/12)*12)
            // console.log(pageIndex)
            // console.log(index+1)    // 12
            // console.log(length)     // 36
            let startingPoint = index - 11
            let pageTotal = 0
            let pageMoney = 0
            for (let j = startingPoint; j <= index; j++) {
              pageTotal += Number(this.tableData[j].customerRepertoryNumber)
              pageMoney += Number(this.tableData[j].customerRepertoryMoney)
            }

            let rowEnd = printTable.insertRow(printTable.FetchRowCount)
            rowEnd.insertCell(0).innerHTML = '本页小计：'
            printTable.rows[pageIndex].cells[0].colSpan = '2'
            rowEnd.insertCell(1).innerHTML = pageTotal
            printTable.rows[pageIndex].cells[1].colSpan = '2'
            rowEnd.insertCell(2).innerHTML = '汇总金额：'
            printTable.rows[pageIndex].cells[2].colSpan = '4'
            rowEnd.insertCell(3).innerHTML = pageMoney.toFixed(2)
            printTable.rows[pageIndex].cells[3].colSpan = '10'

            let newHead = document.createElement('div')
            newHead.classList.add("addPrintHead")
            newHead.innerHTML = `
              <p class="rightTag" style="top: ${(index+1)/12 * 14.85 + 3}cm;">白联仓库 红联财务 黄联客户</p>
              <span class="printHead">
                ${this.manufacturerName}${this.jxQuarter}客户库存表2
              </span>
              <div class="info" style="height: 25px;">
                <p style="margin: 5px 0;">厂商：${this.printVendorName}</p>
                <p style="margin: 5px 0;">联系人：${this.contact}</p>
                <p style="margin: 5px 0;">进货序号：${this.inputSequence}</p>
              </div>
              <div class="info" style="height: 25px;">
                <p style="margin: 5px 0;">厂商电话：${this.phone}</p>
                <p style="margin: 5px 0;">进货日期：${this.inputDate}</p>
              </div>
              <div class="info" style="height: 25px;">
                <p style="margin: 5px 0;">公司地址：${this.address}</p>
              </div>
            `
            newHead.style.pageBreakBefore = 'always'
            this.insertAfter(newHead, printTable)

            let tableId = `printTable${(index+1)/12}`
            // console.log(tableId)
            let tableDom = document.createElement("table")
            tableDom.border = '1'
            tableDom.align = 'center'
            tableDom.id = tableId
            tableDom.innerHTML = `
              <thead>
                <tr>
                  <td style="width: 4%;padding: 0;text-align: center;" rowspan="2">序号</td>
                  <td style="width: 12%;padding: 0;text-align: center;" rowspan="2">型色</td>
                  <td style="width: 7%;padding: 0;text-align: center;" rowspan="2">颜色</td>
                  <td style="width: 15%;padding: 0;text-align: center;" rowspan="2">品名</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">05</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">07</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">09</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">11</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">13</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">15</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">17</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">19</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">21</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">23</td>
                  <td style="width: 3.8%;padding: 0;text-align: center;">F</td>
                  <td rowspan="2" style="text-align: center;width: 5%;">数量</td>
                  <td rowspan="2" style="text-align: center;width: 5%;">售价</td>
                  <td rowspan="2" style="text-align: center;">金额</td>
                </tr>
                <tr>
                  <td style="text-align: center;border-top: 1px dotted;border-left: 1px dotted;">XS</td>
                  <td style="text-align: center;border-top: 1px dotted;">S</td>
                  <td style="text-align: center;border-top: 1px dotted;">M</td>
                  <td style="text-align: center;border-top: 1px dotted;">L</td>
                  <td style="text-align: center;border-top: 1px dotted;">XL</td>
                  <td style="text-align: center;border-top: 1px dotted;">2L</td>
                  <td style="text-align: center;border-top: 1px dotted;">3L</td>
                  <td style="text-align: center;border-top: 1px dotted;">4L</td>
                  <td style="text-align: center;border-top: 1px dotted;">5L</td>
                  <td style="text-align: center;border-top: 1px dotted;">6L</td>
                  <td style="text-align: center;border-top: 1px dotted;"></td>
                </tr>
              </thead>
            `
            // console.log(tableDom)
            // console.log(index)
            this.printStyleCount(e.styleNumber)
            this.insertAfter(tableDom, newHead)
            this.openPrint(false,index+2,tableId)
            return
          }
          if ((index+1) == length) {
            let pageIndex = index + 3 - (parseInt(index/12)*12)
            // console.log('最后一行')
            let startingPoint = index < 12 ? 0 : parseInt(index/12)*12
            let pageTotal = 0
            let pageMoney = 0
            for (let j = startingPoint; j <= index; j++) {
              pageTotal += Number(this.tableData[j].customerRepertoryNumber)
              pageMoney += Number(this.tableData[j].customerRepertoryMoney)
            }
            let rowEnd = printTable.insertRow(printTable.FetchRowCount)
            rowEnd.insertCell(0).innerHTML = '本页小计：'
            printTable.rows[pageIndex].cells[0].colSpan = '2'
            rowEnd.insertCell(1).innerHTML = pageTotal
            printTable.rows[pageIndex].cells[1].colSpan = '2'
            rowEnd.insertCell(2).innerHTML = '汇总金额：'
            printTable.rows[pageIndex].cells[2].colSpan = '4'
            rowEnd.insertCell(3).innerHTML = pageMoney.toFixed(2)
            printTable.rows[pageIndex].cells[3].colSpan = '10'
          }
        }

        this.printStyleCount(e.styleNumber)
      }

      this.printStyle = this.styleList.length
      // console.log(this.styleList)
      let int = setInterval(() => {
        if (this.printStyle) {
          clearInterval(int)
          let printHtml = document.getElementById('p').innerHTML
          let wind = window.open("",'newwindow', 'height=500, width=1000, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
          wind.document.body.innerHTML = printHtml
          let style = document.createElement('style')
          style.type = 'text/css'
          style.innerHTML = resources.printCSS
          wind.document.head.appendChild(style)
          wind.print()
          return false
        }
      }, 500)
    },

    printStyleCount(s){
      if (!this.styleList.length) {
        this.styleList.push(s)
      } else {
        let exist = 0
        for (const i of this.styleList) {
          // console.log(i)
          if (i == s) {
            exist = 1
            break
          }
        }
        if (!exist) {
          this.styleList.push(s)
        }
      }
    },

    clearPrintTable(){
      let printTable = document.getElementById("printTable")
      let trs = printTable.getElementsByTagName("tr")
      let len = trs.length - 1
      for(let i = len; i > 1; i--) {
        printTable.deleteRow(i)
      }

      let printArea = document.getElementById("p")
      let tables = printArea.getElementsByTagName('table')
      len = tables.length
      for (let i = 1; i < len; i++) {
        tables[1].remove()
      }
      let addPrintHeads = document.getElementsByClassName('addPrintHead')
      len = addPrintHeads.length
      for (let i = 0; i < len; i++) {
        addPrintHeads[0].remove()
      }
    },
    

     // 因为js没有直接追加到指定元素后面的方法 所以要自己创建一个方法
    insertAfter( newElement, targetElement ){ // newElement是要追加的元素 targetElement 是指定元素的位置
      let parent = targetElement.parentNode // 找到指定元素的父节点
      if( parent.lastChild == targetElement ){ // 判断指定元素的是否是节点中的最后一个位置 如果是的话就直接使用appendChild方法
        parent.appendChild( newElement, targetElement )
      }else{
        parent.insertBefore( newElement, targetElement.nextSibling )
      }
    },


    aka(w,q){
      w.depositRepertoryNumber = Number(q.depositRepertoryNumber) + Number(w.depositRepertoryNumber);
      w.customerInputNumber = Number(q.customerInputNumber) + Number(w.customerInputNumber);
      w.customerOutNumber = Number(q.customerOutNumber) + Number(w.customerOutNumber);
      w.customerSellNumber = Number(q.customerSellNumber) + Number(w.customerSellNumber);
      w.customerSellMoney = Number(q.customerSellMoney) + Number(w.customerSellMoney);
      w.customerRepertoryNumber = Number(q.customerRepertoryNumber) + Number(w.customerRepertoryNumber);
    },
    //筛选
    Screen(Arr1){
      let index = this.calculationList.indexOf('styleNumber')
      let index1 = this.calculationList.indexOf('colorNo')
      let index2 = this.calculationList.indexOf('brandedName')
      let index3 = this.calculationList.indexOf('size')
      let index4 = this.calculationList.indexOf('sellingPrice')
      let index5 = this.calculationList.indexOf('customerNo')

      if(index != -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 == -1){//颜色 尺寸 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName){
              flag=false;
              this.aka(this.result[w],Arr1[q])//调用共享函数赋值
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 != -1){//全选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])//调用共享函数赋值
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 != -1){ //款号不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 != -1){ //款号 颜色不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 != -1){ //款号 品牌不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 != -1){ //款号 尺码不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 != -1){ //款号 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 == -1){ //款号 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 != -1){ //款号 颜色 品牌不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 != -1){ //款号 颜色 尺寸不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 != -1){ //款号 颜色 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 == -1){ //款号 颜色 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 != -1){ //款号 品牌 尺寸不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 != -1){ //款号 品牌 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].size == this.result[w].size && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 == -1){ //款号 品牌 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 != -1){ //款号 尺寸 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 == -1){ //款号 尺寸 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 == -1){ //款号 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 != -1){ //款号 颜色 品牌 尺寸不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 != -1){//款号 颜色 尺寸 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 == -1){//款号 颜色 尺寸 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 != -1){//款号 颜色 品牌 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 == -1){ //款号 颜色 品牌 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 == -1){//款号 颜色 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].brandedName == this.result[w].brandedName){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      
      if(index != -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 != -1){ //颜色不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 != -1){ //颜色 品牌不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 != -1){ //颜色 尺码不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 != -1){ //颜色 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 == -1){ //颜色 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 != -1){ //颜色 品牌 尺码不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 != -1){ //颜色 品牌 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].size == this.result[w].size && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 == -1){ //颜色 品牌 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 != -1){//颜色 尺寸 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])//调用共享函数赋值
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 == -1){//颜色 尺寸 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])//调用共享函数赋值
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 == -1){//颜色 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName  && Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])//调用共享函数赋值
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 == -1 && index5 != -1){ //颜色 品牌 尺码 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 == -1){ //颜色 品牌 尺码 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 == -1){//颜色 品牌 售价 客户不选
        this.result=[];
          let flag=true;
          this.result.push(Arr1[0]);
          for(let q=1;q<Arr1.length;q++){
            flag=true;
            for(let w=0;w<this.result.length;w++){
              if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].size == this.result[w].size){
                flag=false;
                this.aka(this.result[w],Arr1[q])
              }
            }
            if(flag==true)
            this.result.push(Arr1[q]);
          }
          console.log(this.result)
        return
      }

      if(index != -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 == -1){//颜色 尺寸 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName){
              flag=false;
              this.aka(this.result[w],Arr1[q])//调用共享函数赋值
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }




      if(index != -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 != -1){ //品牌不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size && Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 != -1){ //品牌 尺码不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 != -1){ //品牌 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].size == this.result[w].size && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 != -1 && index5 == -1){ //品牌 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].size == this.result[w].size && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 == -1 && index3 == -1 && index4 == -1 && index5 != -1){ //品牌 尺码 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 == -1){ //品牌 尺码 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }


      if(index != -1 && index1 != -1 && index2 == -1 && index3 == -1 && index4 == -1 && index5 == -1){ //品牌 尺码 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 == -1){ //品牌 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].size == this.result[w].size){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }


      if(index != -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 != -1){ //尺码不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 != -1){ //尺码 售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 != -1 && index5 == -1){ //尺码 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 == -1){ //尺码 售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].brandedName == this.result[w].brandedName){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }


      if(index != -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 != -1){//售价不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].customerNo == this.result[w].customerNo){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 == -1 && index5 == -1){//售价 客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index != -1 && index1 != -1 && index2 != -1 && index3 != -1 && index4 != -1 && index5 == -1){//客户不选
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber && Arr1[q].brandedName == this.result[w].brandedName && Arr1[q].size == this.result[w].size && Arr1[q].colorNo == this.result[w].colorNo && Arr1[q].sellingPrice == this.result[w].sellingPrice){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }


      if(index != -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 == -1 && index5 == -1){//只有款号
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].styleNumber == this.result[w].styleNumber){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 != -1 && index2 == -1 && index3 == -1 && index4 == -1 && index5 == -1){//只颜色
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].colorNo == this.result[w].colorNo){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 != -1 && index3 == -1 && index4 == -1 && index5 == -1){//只品牌
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].brandedName == this.result[w].brandedName){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 != -1 && index4 == -1 && index5 == -1){//只尺寸
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].size == this.result[w].size){
            flag=false;
            this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 == -1 && index5 != -1){ //只客户
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].customerNo == this.result[w].customerNo){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      if(index == -1 && index1 == -1 && index2 == -1 && index3 == -1 && index4 != -1 && index5 == -1){ //只售价
        this.result=[];
        let flag=true;
        this.result.push(Arr1[0]);
        for(let q=1;q<Arr1.length;q++){
          flag=true;
          for(let w=0;w<this.result.length;w++){
            if(Arr1[q].sellingPrice == this.result[w].sellingPrice){
              flag=false;
              this.aka(this.result[w],Arr1[q])
            }
          }
          if(flag==true)
          this.result.push(Arr1[q]);
        }
        console.log(this.result)
        return
      }

      // this.newArr = []
      // var temp = {};
      // var Arr
      // if(this.newArr == ''){Arr = Arr1}else{Arr = this.newArr}
      // let index = this.calculationList.indexOf('styleNumber')
      // // console.log(index)
      // if(index != -1){
      //   for(let i in Arr){
      //     var key = Arr[i].styleNumber; 
      //       // console.log(temp[key])
      //       if(temp[key]) {
      //         console.log(temp[key])
      //           temp[key].styleNumber = temp[key].styleNumber;
      //           temp[key].depositRepertoryNumber = temp[key].depositRepertoryNumber + Arr[i].depositRepertoryNumber;
      //           temp[key].customerInputNumber = temp[key].customerInputNumber + Arr[i].customerInputNumber;
      //           temp[key].customerOutNumber = temp[key].customerOutNumber + Arr[i].customerOutNumber;
      //           temp[key].customerSellNumber = temp[key].customerSellNumber + Arr[i].customerSellNumber;
      //           temp[key].customerSellMoney = temp[key].customerSellMoney + Arr[i].customerSellMoney;
      //           temp[key].customerRepertoryNumber = temp[key].customerRepertoryNumber + Arr[i].customerRepertoryNumber;
      //       } else {
      //           temp[key] = {};
      //           temp[key].styleNumber = Arr[i].styleNumber;
      //           temp[key].depositRepertoryNumber = Arr[i].depositRepertoryNumber;
      //           temp[key].customerInputNumber = Arr[i].customerInputNumber;
      //           temp[key].customerOutNumber = Arr[i].customerOutNumber;
      //           temp[key].customerSellNumber = Arr[i].customerSellNumber;
      //           temp[key].customerSellMoney = Arr[i].customerSellMoney;
      //           temp[key].customerRepertoryNumber = Arr[i].customerRepertoryNumber;
      //       }
      //       temp[key].colorNo = Arr[i].colorNo;
      //       temp[key].size = Arr[i].size;
      //       temp[key].sellingPrice = Arr[i].sellingPrice;
      //       temp[key].customerNo = Arr[i].customerNo;
      //       temp[key].brandedName = Arr[i].brandedName;
      //       temp[key].ItemType = Arr[i].customerInputNumber;
      //       temp[key].firstInputDate = Arr[i].firstInputDate;
      //       temp[key].firstSellDate = Arr[i].firstSellDate;
      //   }
      //   this.newArr = []
      //   for(let k in temp){
      //     this.newArr.push(temp[k])
      //   }
      //   // alert(JSON.stringify(newfood));
      //   console.log(this.newArr)
      //   temp = {}
      // };
    },


    FilterData(a,b){   //循环判断数组a里的元素在b里面有没有，有的话就放入新建立的数组中
      this.resultList = []
      for(var i=0;i<a.length;i++){
			  if(b.indexOf(a[i]) != -1)	
          {
            this.resultList.push(a[i]);
          }      
        }
          // return this.resultList;
          console.log(this.resultList)
        },
    getCalculationList(){
      this.calculationList = JSON.parse(JSON.stringify(this.selectHeaderList)) //实现深克隆 修改calculationList时 不改变selectHeaderList的原始值
      for(let y in this.calculationList){
        if(this.calculationList[y] == '款号'){this.calculationList[y]='styleNumber'}
        if(this.calculationList[y] == '颜色'){this.calculationList[y]='colorNo'}
        if(this.calculationList[y] == '品牌名称'){this.calculationList[y]='brandedName'}
        if(this.calculationList[y] == '尺码'){this.calculationList[y]='size'}
        if(this.calculationList[y] == '售价'){this.calculationList[y]='sellingPrice'}
        if(this.calculationList[y] == '客户简称'){this.calculationList[y]='customerNo'}
      }
      console.log(this.calculationList)
    },
    exportExcel(){
      if(this.isTwoQuery){
        let obj = {
          isExport:true,
          "pageData.page":this.currentPage,
          "pageData.limit":this.limit,
          isHeadquarters:this.isHeadquarters,
          isCustomerTotal:this.isCustomerTotal,
          customerId:this.customerId,
          styleNumberList:this.kindsNumberListStr == '' ? null : this.kindsNumberListStr,
          headquartersNo:this.headquartersNo,
          inventoryExpression:this.inventoryExpression == '>=' ? -1 :(this.inventoryExpression == '=' ? 1 : 0),
          inventory:this.inventory,
          businessListStr: this.businessListStr == '' ? null : JSON.stringify(this.businessListStr).replace(/\[|]/g ,'').replace(/\"|"/g ,''),
          quarterIdList:this.quarterListStr == '' ? null : JSON.stringify(this.quarterListStr).replace(/\[|]/g ,''),
          startTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[0].slice(0,4) + this.timeDate[0].slice(5,7) + this.timeDate[0].slice(8,10)),
          endTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[1].slice(0,4) + this.timeDate[1].slice(5,7) + this.timeDate[1].slice(8,10)),
          brandedId:this.brandedName,
          commodityTypeId:this.commodityType,
          actualSales:this.actualSales,
          actualInput:this.actualInput,
          noExportList:JSON.stringify(this.ary1).replace(/\[|]/g ,'').replace(/\"|"/g ,'')
        }
        getTwoCI(obj).then(res=>{
          var ck = res.data.data
          location.href = `${ck}`
        })
      }else{
      let obj = {
        isExport:true,
        "pageData.page":this.currentPage,
        "pageData.limit":this.limit,
        isHeadquarters:this.isHeadquarters,
        isCustomerTotal:this.isCustomerTotal,
        customerId:this.customerId,
        styleNumberList:this.kindsNumberListStr == '' ? null : this.kindsNumberListStr,
        headquartersNo:this.headquartersNo,
        inventoryExpression:this.inventoryExpression == '>=' ? -1 :(this.inventoryExpression == '=' ? 1 : 0),
        inventory:this.inventory,
        businessListStr: this.businessListStr == '' ? null : JSON.stringify(this.businessListStr).replace(/\[|]/g ,'').replace(/\"|"/g ,''),
        quarterIdList:this.quarterListStr == '' ? null : JSON.stringify(this.quarterListStr).replace(/\[|]/g ,''),
        startTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[0].slice(0,4) + this.timeDate[0].slice(5,7) + this.timeDate[0].slice(8,10)),
        endTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[1].slice(0,4) + this.timeDate[1].slice(5,7) + this.timeDate[1].slice(8,10)),
        brandedId:this.brandedName,
        commodityTypeId:this.commodityType,
        actualSales:this.actualSales,
        actualInput:this.actualInput,
        noExportList:JSON.stringify(this.ary).replace(/\[|]/g ,'').replace(/\"|"/g ,'')
      }
      console.log(obj)
      getCI(obj).then(res=>{
        console.log(res.data)
        var ck = res.data.data
        location.href = `${ck}`
      })
      }
      
    },
    handleSizeChange(val){//每页多少条
      this.limit = val
      //总页码
      this.pagesNum = Math.ceil(this.dataLen/this.limit)
      let params = {
        limit: this.limit,
        page: this.currentPage
      }
      this.query(params)
    },
    handleCurrentChange(val){//当前页
      this.currentPage = val
      let params = {
          limit: this.limit,
          page: val
        }
      this.query(params)
    },
    //筛选的款号 季度
    preservation(data){
      console.log(data)
      console.log(data[0],data[1])
      this.kindsNumberListStr = JSON.stringify(data[1]).replace(/\[|]/g, '').replace(/\"|"/g, ''),//转数组去中括号
      console.log(this.kindsNumberListStr)
      this.quarterListStr = data[0]
    },

    Change(){
      for(const i of this.customerList){
        if(i.value + i.value2 == this.customerName){
          this.customerNo = i.value1
          this.customerId = i.value2
        }
        if(this.customerName == ''){this.customerId = ''}
      }
    },
    Change1(){
      for(const i of this.customerList){
        if(i.value1 == this.customerNo){
          this.customerName = i.value
          this.customerId = i.value2
        }
        if(this.customerNo == ''){this.customerId = ''}
      }
    },
    query(){
      this.imgSrc = ''
      // var str = "sss-ccc,ccc-sss,aaa-bbb"
      // console.log(str.split(','))

              //遍历多选给每个加单引号
      // let a = ''
      // this.kindsNumberListStr.forEach(e=>{
      //   if(!a){
      //     a = `'${e}'`
      //   }else{
      //     a = `${a},'${e}'`
      //   }
      //   console.log(a)
      // })
      if(this.isTwoQuery){
        this._getTwoCI()
      }else{
        this._getCI()
      }
    },
    //一维
    _getCI(){
      // let pageData = {
      //   limit:this.limit,
      //   page:this.currentPage
      // }
      let obj = {
        isExport:false,
        "pageData.page":this.currentPage,
        "pageData.limit":this.limit,
        isHeadquarters:this.isHeadquarters,
        isCustomerTotal:this.isCustomerTotal,
        customerId:this.customerId,
        styleNumberList:this.kindsNumberListStr == '' ? null : this.kindsNumberListStr,
        headquartersNo:this.headquartersNo,
        inventoryExpression:this.inventoryExpression == '>=' ? -1 :(this.inventoryExpression == '=' ? 1 : 0),
        inventory:this.inventory,
        businessListStr: this.businessListStr == '' ? null : JSON.stringify(this.businessListStr).replace(/\[|]/g ,'').replace(/\"|"/g ,''),
        quarterIdList:this.quarterListStr == '' ? null : JSON.stringify(this.quarterListStr).replace(/\[|]/g ,''),
        startTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[0].slice(0,4) + this.timeDate[0].slice(5,7) + this.timeDate[0].slice(8,10)),
        endTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[1].slice(0,4) + this.timeDate[1].slice(5,7) + this.timeDate[1].slice(8,10)),
        brandedId:this.brandedName,
        commodityTypeId:this.commodityType,
        actualSales:this.actualSales,
        actualInput:this.actualInput,
      }
      // console.log(obj)
      //合计
      getSum(obj).then(res=>{
        console.log(res.data)
        this.depositRepertoryNumber = res.data.data.depositRepertoryNumber
        this.customerInputNumber = res.data.data.customerInputNumber
        this.customerOutNumber = res.data.data.customerOutNumber
        this.customerSellNumber = res.data.data.customerSellNumber
        this.customerSellMoney = res.data.data.customerSellMoney
        this.customerRepertoryNumber = res.data.data.customerRepertoryNumber
      })
      getCI(obj).then(res=>{
        // console.log(res)
        if(res.data.data != null && res.data.code == 200){
          // for(var cno in this.customerList){
          for(let w in res.data.data){
            res.data.data[w].colorNo = `${res.data.data[w].colorNo} - ${res.data.data[w].colorName}`
            res.data.data[w].customerNo = `${res.data.data[w].customerNo} - ${res.data.data[w].customerName}`
            if(res.data.data[w].customerInputNumber == 0){
              res.data.data[w].customerInputNumber = ''
            }
            if(res.data.data[w].customerOutNumber == 0){
              res.data.data[w].customerOutNumber = ''
            }
            if(res.data.data[w].customerSellNumber == 0){
              res.data.data[w].customerSellNumber = ''
            }
            if(res.data.data[w].sellMoney == 0){
              res.data.data[w].sellMoney = ''
            }
            if(res.data.data[w].customerRepertoryNumber == 0){
              res.data.data[w].customerRepertoryNumber = ''
            }
            if(res.data.data[w].depositRepertoryNumber == 0){
              res.data.data[w].depositRepertoryNumber = ''
            }
            if(res.data.data[w].firstInputDate == null){res.data.data[w].firstInputDate = ''}else{
                res.data.data[w].firstInputDate = String(res.data.data[w].firstInputDate).slice(0,4) + '-' + String(res.data.data[w].firstInputDate).slice(4,6) + '-' + String(res.data.data[w].firstInputDate).slice(6,8)
            }
            if(res.data.data[w].firstSellDate == null){res.data.data[w].firstSellDate = ''}else{
                res.data.data[w].firstSellDate = String(res.data.data[w].firstSellDate).slice(0,4) + '-' + String(res.data.data[w].firstSellDate).slice(4,6) + '-' + String(res.data.data[w].firstSellDate).slice(6,8)
              }
            // if(this.customerList[cno].value1 == res.data.data[w].customerNo){
            //   res.data.data[w]['cusName'] = this.customerList[cno].value
            // }
          // }
          }

          let arrSortMinToMax = (a, b) => {
            let cReg = /^[\u4E00-\u9FCC\u3400-\u4DB5\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d]/
            if (!cReg.test(a.styleNumber) || !cReg.test(b.styleNumber)) {
              return a.styleNumber.localeCompare(b.styleNumber)
            } else {
              return a.styleNumber.localeCompare(b.styleNumber, "zh")
            }
          }
          // let arr = [{ name: "d" }, { name: "江" }, { name: "8" }, { name: "j" }, { name: "1" }, { name: "水" }]
          this.sortArr = res.data.data.sort(arrSortMinToMax)
          // console.log(sortArr) //  数组中 英文数组组合  排序 数字优先
          // this.List = [...sortArr.reduce((s, o) => (Object.keys(o).forEach(k => s.add(k)), s), new Set)];
          // console.log(this.List);

          this.Screen(this.sortArr)
          
          this.dataLen = res.data.total
          if(this.result != ''){
              this.tableData = this.result
            }else{
              this.tableData = this.sortArr
            }
          
          console.log(this.dataLen)
          // this.tableData = sortArr.slice((this.currentPage-1)*this.limit,this.currentPage*this.limit)

        }else if(res.data.data == null){
          this.tableData = []
          this.currentPage = 1
          this.dataLen = 0
        }
      })
    },

    //二维
    _getTwoCI(){
      
      let obj = {
        isExport:false,
        "pageData.page":this.currentPage,
        "pageData.limit":this.limit,
        isHeadquarters:this.isHeadquarters,
        isCustomerTotal:this.isCustomerTotal,
        customerId:this.customerId,
        styleNumberList:this.kindsNumberListStr == '' ? null : this.kindsNumberListStr,
        headquartersNo:this.headquartersNo,
        inventoryExpression:this.inventoryExpression == '>=' ? -1 :(this.inventoryExpression == '=' ? 1 : 0),
        inventory:this.inventory,
        businessListStr: this.businessListStr == '' ? null : JSON.stringify(this.businessListStr).replace(/\[|]/g ,'').replace(/\"|"/g ,''),
        quarterIdList:this.quarterListStr == '' ? null : JSON.stringify(this.quarterListStr).replace(/\[|]/g ,''),
        startTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[0].slice(0,4) + this.timeDate[0].slice(5,7) + this.timeDate[0].slice(8,10)),
        endTime:(this.timeDate == null || this.timeDate == '') ? '' : Number(this.timeDate[1].slice(0,4) + this.timeDate[1].slice(5,7) + this.timeDate[1].slice(8,10)),
        brandedId:this.brandedName,
        commodityTypeId:this.commodityType,
        actualSales:this.actualSales,
        actualInput:this.actualInput,
      }
      // console.log(obj)
      getSum1(obj).then(res=>{
        console.log(res.data)
        if(res.data.data != null){
          this.repertoryFiveNumber = res.data.data.repertoryFiveNumber
          this.repertorySevenNumber = res.data.data.repertorySevenNumber
          this.repertoryNineNumber = res.data.data.repertoryNineNumber
          this.repertoryElevenNumber = res.data.data.repertoryElevenNumber
          this.repertoryThirteenNumber = res.data.data.repertoryThirteenNumber
          this.repertoryFifteenNumber = res.data.data.repertoryFifteenNumber
          this.repertorySeventeenNumber = res.data.data.repertorySeventeenNumber
          this.repertoryNineteenNumber = res.data.data.repertoryNineteenNumber
          this.repertoryTwentyOneNumber = res.data.data.repertoryTwentyOneNumber
          this.repertoryTwentyThreeNumber = res.data.data.repertoryTwentyThreeNumber
          this.repertoryFNumber = res.data.data.repertoryFNumber
          this.customerRepertoryNumber = res.data.data.customerRepertoryNumber
          this.customerRepertoryMoney = res.data.data.customerRepertoryMoney
        }
      })
      getTwoCI(obj).then(res=>{
        // console.log(res.data)
        if(res.data.data == null){
          this.tableData = []
          this.dataLen = 0
          this.currentPage = 1
        }
        if(res.data.code == 200 && res.data.data != null){
          for(let u in res.data.data){
            // res.data.data[u]['customerRepertoryNumber'] = res.data.data[u].repertoryFiveNumber+res.data.data[u].repertorySevenNumber+res.data.data[u].repertoryNineNumber+res.data.data[u].repertoryElevenNumber+res.data.data[u].repertoryThirteenNumber+res.data.data[u].repertoryFifteenNumber+res.data.data[u].repertorySeventeenNumber+res.data.data[u].repertoryNineteenNumber+res.data.data[u].repertoryTwentyOneNumber+res.data.data[u].repertoryTwentyThreeNumber+res.data.data[u].repertoryFNumber
            if(res.data.data[u].repertoryFiveNumber == 0)res.data.data[u].repertoryFiveNumber = ''
            if(res.data.data[u].repertorySevenNumber == 0)res.data.data[u].repertorySevenNumber = ''
            if(res.data.data[u].repertoryNineNumber == 0)res.data.data[u].repertoryNineNumber = ''
            if(res.data.data[u].repertoryElevenNumber == 0)res.data.data[u].repertoryElevenNumber = ''
            if(res.data.data[u].repertoryThirteenNumber == 0)res.data.data[u].repertoryThirteenNumber = ''
            if(res.data.data[u].repertoryFifteenNumber == 0)res.data.data[u].repertoryFifteenNumber = ''
            if(res.data.data[u].repertorySeventeenNumber == 0)res.data.data[u].repertorySeventeenNumber = ''
            if(res.data.data[u].repertoryNineteenNumber == 0)res.data.data[u].repertoryNineteenNumber = ''
            if(res.data.data[u].repertoryTwentyOneNumber == 0)res.data.data[u].repertoryTwentyOneNumber = ''
            if(res.data.data[u].repertoryTwentyThreeNumber == 0)res.data.data[u].repertoryTwentyThreeNumber = ''
            if(res.data.data[u].repertoryFNumber == 0)res.data.data[u].repertoryFNumber = ''
            if(res.data.data[u].firstInputDate == null){res.data.data[u].firstInputDate = ''}else{
                res.data.data[u].firstInputDate = String(res.data.data[u].firstInputDate).slice(0,4) + '-' + String(res.data.data[u].firstInputDate).slice(4,6) + '-' + String(res.data.data[u].firstInputDate).slice(6,8)
              }
          }
          this.tableData = res.data.data
          // this.tableData = res.data.data.slice((this.currentPage-1)*this.limit,this.currentPage*this.limit)
          this.dataLen = res.data.total
        }else{
          this.tableData = []
          this.dataLen = 0
          this.currentPage = 1
        }
        
      })
    },
    
    closeScn(){
      this.Scn = 'none'
    },
    showscn(){
      this.Scn = 'block'
    },
    //指定列求和
    getList(param) {
      // console.log(this.zt)
          const { columns, data } = param;
          const sums = [];
          columns.forEach((column, index) => {
            if (index === 0) {
              sums[index] = '合计';
              return;
            }
            const prop = column.property
            switch (prop){
              case 'depositRepertoryNumber' :
                sums[index] = this.depositRepertoryNumber || ''
                break;
              case 'customerInputNumber' :
                sums[index] = this.customerInputNumber || ''
                break;
              case 'customerOutNumber' :
                sums[index] = this.customerOutNumber || ''
                break;
              case 'customerSellNumber' :
                sums[index] = this.customerSellNumber || ''
                break;
              case 'customerSellMoney' :
                sums[index] = this.customerSellMoney || ''
                break;
              case 'customerRepertoryNumber' :
                sums[index] = this.customerRepertoryNumber || ''
                break;

              case 'repertoryFiveNumber' :
                sums[index] = this.repertoryFiveNumber || ''
                break;
              case 'repertorySevenNumber' :
                sums[index] = this.repertorySevenNumber || ''
                break;
              case 'repertoryNineNumber' :
                sums[index] = this.repertoryNineNumber || ''
                break;
              case 'repertoryElevenNumber' :
                sums[index] = this.repertoryElevenNumber || ''
                break;
              case 'repertoryThirteenNumber' :
                sums[index] = this.repertoryThirteenNumber || ''
                break;
              case 'repertoryFifteenNumber' :
                sums[index] = this.repertoryFifteenNumber || ''
                break;
                case 'repertorySeventeenNumber' :
                sums[index] = this.repertorySeventeenNumber || ''
                break;
              case 'repertoryNineteenNumber' :
                sums[index] = this.repertoryNineteenNumber || ''
                break;
              case 'repertoryTwentyOneNumber' :
                sums[index] = this.repertoryTwentyOneNumber || ''
                break;
              case 'repertoryTwentyThreeNumber' :
                sums[index] = this.repertoryTwentyThreeNumber || ''
                break;
              case 'repertoryFNumber' :
                sums[index] = this.repertoryFNumber || ''
                break;
              case 'customerRepertoryNumber' :
                sums[index] = this.customerRepertoryNumber || ''
                break;
              case 'customerRepertoryMoney' :
                sums[index] = this.customerRepertoryMoney || ''
                break;
            }
        });
        return sums
    },

    rowClick(row) {
      // console.log(row);
      if (!this.showImg) return
      if (row.imageUrl) {
        this.imgSrc = row.imageUrl
      } else {
        this.imgSrc = ''
        this.$message.info('暂无图片')
      }
    }
  },

  watch:{
    kindsNumberListStr(a,b){
      if(a != undefined){
        this.kindsNumberListStr = a.toUpperCase().trim().replace(/，/ig,',')//中文逗号转英文
      }
    },
    isCustomerTotal(a,b){
      if(a){
        this.cList1[0].isShow = false
        this.cList1[1].isShow = false
        this.cList1[2].isShow = false
        this.cList1[3].isShow = false
        this.cList1[5].isShow = false
        // this.selectHeaderList = [],//foot-view
        // this.headerList = [{value:'款号'},{value:'颜色'},{value:'售价'},{value:'客户简称'},{value:'品牌名称'},{value:'尺码'}]
        this.ary.push('款号','颜色名称','颜色编号','尺寸','售价','品牌名称')
        
        if(this.isTwoQuery){
          this._getTwoCI()
        }else{
          this._getCI()
        }
      }else{
        this.cList1[0].isShow = true
        this.cList1[1].isShow = true
        this.cList1[2].isShow = true
        this.cList1[3].isShow = true
        this.cList1[5].isShow = true
        // this.selectHeaderList = ['款号','颜色','售价','客户简称','品牌名称','尺码'],//foot-view
        // this.headerList = [{value:'款号'},{value:'颜色'},{value:'售价'},{value:'客户简称'},{value:'品牌名称'},{value:'尺码'}],
        this.ary = ['季度','季度id','货号id','客户id','id','货号值']
      }
      if(this.isTwoQuery){
          this._getTwoCI()
        }else{
          this._getCI()
        }
    },
    isTwoQuery(a,b){
      if (a) {
        console.log(1)
        this.cList = this.cList2
        this.showcheck = 'block'
        // this.query()
        this.dataLen = 1
        this.currentPage = 1
        this._getTwoCI()
      }else{
        this.cList = this.cList1
        this.showcheck = 'none'
        this.dataLen = 1
        this.currentPage = 1
        this._getCI()
      }
    },
    isHeadquarters(a,b){
      console.log(a,b)
      if(a){
        this.query()
      }
      if(!a){
        this.query()
      }
    },
    dataLen(a,b){
      this.pagesNum = Math.ceil(this.dataLen/this.limit)
      console.log(this.pagesNum)
    },
    limit(a,b){
      this.pagesNum = Math.ceil(this.dataLen / this.limit)
    },
    selectHeaderList(a,b){
      // console.log(a)
      this.getCalculationList()
      if(!this.isTwoQuery){
        this.Screen(this.sortArr)
        if(this.result != ''){
          this.tableData = this.result
        }else{
          this.tableData = this.sortArr
        }
      }

      this.headerList.forEach(e => {
        this.sendList = []
        this.sendList2 = []
        if (a.indexOf(e.value) == -1) {
          this.sendList = this.cList1.filter(i => {return i.label == e.value})
          if(this.sendList.length) {this.sendList[0].isShow = false}

          this.sendList.forEach(e=>{
            this.sendList3.push(e.label)
          })
          // console.log(this.sendList3)
          this.ary = ['季度','季度id','货号id','客户id','id','货号值'];
          for(let i=0;i<this.sendList3.length;i++){ //数组去重
                var d=this.sendList3[i] 
                if(this.ary.indexOf(d)==-1){
                  // console.log(d)
                  if(d == '颜色'){
                    this.ary.push('颜色名称','颜色编号')
                  }
                    this.ary.push(this.sendList3[i])
                }
          }
          // console.log(this.ary)

          this.sendList2 = this.cList2.filter(i => {return i.label == e.value})
          if(this.sendList2.length) this.sendList2[0].isShow = false

          this.sendList2.forEach(e=>{
            this.sendList4.push(e.label)
          })
          this.ary1 = ['季度','季度id','客户id','颜色编号','客户c05客存数量','客户c07客存数量','客户c09客存数量','客户c11客存数量','客户c13客存数量','客户c15客存数量',
                      '客户c17客存数量','客户c19客存数量','客户c21客存数量','客户c23客存数量','客户F客存数量','客户库存数量'];
          for(let t=0;t<this.sendList4.length;t++){
            if(this.ary1.indexOf(this.sendList4[t]) == -1){
              this.ary1.push(this.sendList4[t])
            }
          }
          // console.log(this.ary1)

        }
        else{
          this.sendList = this.cList1.filter(i => {return i.label == e.value})
          if(this.sendList.length) this.sendList[0].isShow = true
          this.sendList2 = this.cList2.filter(i => {return i.label == e.value})
          if(this.sendList2.length) this.sendList2[0].isShow = true
        }
      })
      console.log(this.headerList)
      
    }
  },
  mounted(){
    
  }
}
</script>